﻿#pragma once

#ifndef QCEFAPP_H
#define QCEFAPP_H

#include "QCefHeader.h"
#include "QCefDebug.h"
#include "QCefConfig.h"

class QCefApp : public CefApp
{
public:
    QCefApp();
    virtual ~QCefApp();

public:
    void checkInClient(void* client);
    void checkOutClient(void* client);
    bool isSafeToExit();

protected:
    std::unordered_set<void*> m_clients;

public:
    //////////////////////////////////////////////////////////////////////////
    //CefApp
    virtual void OnBeforeCommandLineProcessing( const CefString& process_type,
                                               CefRefPtr<CefCommandLine> command_line) override;

    virtual void OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar) override;


    virtual CefRefPtr<CefResourceBundleHandler> GetResourceBundleHandler() override;


    virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override;


    virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() override;

};

#endif  // QCEFAPP_H
